package demo.formater;

import java.text.DateFormat;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class Localization {
	public static void main(String[] args) throws ParseException {
		double amount = 1276789.34;
		double percent = 0.95;
		Locale india = new Locale("en", "IN");
		Locale america = new Locale("en", "US");
		Locale germany = new Locale("de", "DE");
		NumberFormat nfIndia = NumberFormat.getNumberInstance(india);
		NumberFormat nfAmerica = NumberFormat.getNumberInstance(america);
		NumberFormat nfGermany = NumberFormat.getNumberInstance(germany);
		System.out.println(nfIndia.format(amount));
		System.out.println(nfAmerica.format(amount));
		System.out.println(nfGermany.format(amount));
		nfIndia = NumberFormat.getCurrencyInstance(india);
		nfAmerica = NumberFormat.getCurrencyInstance(america);
		nfGermany = NumberFormat.getCurrencyInstance(germany);
		System.out.println(nfIndia.format(amount));
		System.out.println(nfAmerica.format(amount));
		System.out.println(nfGermany.format(amount));
		nfIndia = NumberFormat.getPercentInstance(india);
		nfAmerica = NumberFormat.getPercentInstance(america);
		nfGermany = NumberFormat.getPercentInstance(germany);
		System.out.println(nfIndia.format(percent));
		System.out.println(nfAmerica.format(percent));
		System.out.println(nfGermany.format(percent));
//		
		Locale fr = new Locale("fr", "FR");
//		NumberFormat nfr = NumberFormat.getNumberInstance(fr);
//		System.out.println(nfr.format(amount));
//		
//		nfr = NumberFormat.getCurrencyInstance(fr);
//		System.out.println(nfr.format(amount));
//		
//		nfr = NumberFormat.getPercentInstance(fr);
//		System.out.println(nfr.format(percent));
		
		DateFormat df = DateFormat.getDateInstance(DateFormat.DATE_FIELD, fr);
		Calendar cal = Calendar.getInstance();
		Date today = cal.getTime();
		System.out.println(df.format(today));
		String sDate = df.format(today);
		Date dDate = df.parse(sDate);
		System.out.println(df.format(dDate));
//		df = DateFormat.getDateTimeInstance(DateFormat.DATE_FIELD, DateFormat.HOUR0_FIELD, fr);
		System.out.println(df.format(today));
	}

}
